#  author:张靖昆 date:2020/3/6 name:8_内置函数 IDE:PyCharm
# 1.sum()求和
# arr=[1,2,3,4,5]
# print(sum(arr))
# 1-100之和
# total=sum(range(0,101,2))
# print(total)

# 2.map()
# list02=[1,2,15,'12','3']
#
# m=map(lambda x:int(x),list02)
# print(list(m))
users=[
    {'id':'001',"user_name":'admin','user_password':'888','age':20},
    {'id':'002',"user_name":'joke','user_password':'888','age':21},
    {'id':'003',"user_name":'nose','user_password':'888','age':11}
]
# 排序后改变原数据
# users.sort(key=lambda item:item['age'])
# 排序后不变原数据
result=sorted(users,key=lambda item:item['age'])
print(users)
print(result)




